package com.simpou.commons.model.jpa.entity;

import com.simpou.commons.model.entity.AbstractIdentifiableEntity;
import java.io.Serializable;


import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * Entidade JPA identificável concreta.
 *
 * @author Jonas Pereira
 * @since 2013-06-06
 * @version 2013-06-06
 */
@MappedSuperclass
@Access(AccessType.PROPERTY)
public abstract class AbstractJpaIdentifiableEntity<T extends Serializable>
        extends AbstractIdentifiableEntity<T> {

    public AbstractJpaIdentifiableEntity(Class<T> clasz) {
        super(clasz);
    }

    public AbstractJpaIdentifiableEntity() {
        this(null);
    }

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Override
    public T getId() {
        return super.getId();
    }
}
